package com.zzm.validate.web.injector;

import org.apache.commons.validator.Arg;
import org.apache.commons.validator.Field;
import org.apache.commons.validator.Form;

public class VarValueInjector extends ArgInjector {

	public VarValueInjector() {
		this.setInjectKey("var");
	}
	
	@Override
	public String inject(Object bean, Form form,
			Field field, Arg arg, String message) {
		if(!injectable(arg)) {
			return message;
		}
		String varValue = field.getVarValue(arg.getBundle());
		return this.inject(message, arg, varValue);
	}


}
